//
// IUT de Nice / Departement informatique / Module APO Java
// Annee 2011_2012 - Himalaya
//
// Classe T_Plateau_N1 - Tests unitaires des constructeurs 
//
// Auteur : A.Marongiu et S.Guery
//
import java.util.*;

public class T_Plateau_N1 {

   public static void main (String[] args) {

      Tests.Begin("Himalaya.Plateau", "1.0.0");

         Tests.Design("Controle des constructeurs", 3); {
        	 Tests.Case("Constructeur par defaut"); {
  
         			Plateau p = new Plateau();
					Tests.Unit("Plateau [ villages=(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ), sentiers=(), regions=() ]", p.toString());
        	 }

             Tests.Case("Constructeur normal"); {
            		//--- Village	
		            	HashMap<Integer,Ressource>  HmapRessources = new HashMap<Integer,Ressource>();
		        		Commande commande = new Commande();
        		
            			Village village1 = new Village(1,1,HmapRessources,commande,false,"blanc");
            			Village village2 = new Village(2,1,HmapRessources,commande,false,"blanc");
            			Village village3 = new Village(3,1,HmapRessources,commande,false,"blanc");

            			Village[] tabVillage = new Village[3];
            			
            			tabVillage[0] = village1;
            			tabVillage[1] = village2;
            			tabVillage[2] = village3;
            			
            		// --- Sentiers
            			Sentier sentier1 = new Sentier("terre",village1,village2);
            			Sentier sentier2 = new Sentier("pierre", village2,village3);
            			Sentier sentier3 = new Sentier("glace",village3,village1);
            
            			Sentier matSentiers[][] = new Sentier[4][4];
         		
            			matSentiers[1][2] = sentier1; 
            			matSentiers[2][3] = sentier2; 	
            			matSentiers[3][1] = sentier3; 	
            					
            		// --- Regions
            			ArrayList<Village> villagesR1 = new ArrayList<Village>();
            			villagesR1.add(village1);
            			villagesR1.add(village2);
            			ArrayList<Village> villagesR2 = new ArrayList<Village>();
            			villagesR2.add(village2);
            			villagesR2.add(village3);
            			ArrayList<Village> villagesR3 = new ArrayList<Village>();
            			villagesR3.add(village3);
            			villagesR3.add(village1);
            			
            			Region region1 = new Region(1,villagesR1);
            			Region region2 = new Region(2,villagesR2);
            			Region region3 = new Region(3,villagesR3);
            	
            			HashMap<Integer,Region>  HmapRegions = new HashMap<Integer,Region>();

            			HmapRegions.put(1,region1);
            			HmapRegions.put(2,region2);
            			HmapRegions.put(3,region3);

            			Plateau p = new Plateau(tabVillage,matSentiers,HmapRegions);
					
            			Tests.Unit("Plateau [ villages=(1 2 3 ), " +
            								 "sentiers=(terre pierre glace ), " +
            								 "regions=([numero=1, nombre de Delegation=0][numero=2, nombre de Delegation=0][numero=3, nombre de Delegation=0]) ]", p.toString());
            }
         }

      Tests.End();       
   }
}
